﻿using Password_Manager.Database;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Password_Manager
{
    public partial class ModifyUser : Form
    {

        private int id; // 用户ID
        private string ldentificationCode;
        CreateDatabaseAndTables tables = new CreateDatabaseAndTables();
        public ModifyUser(int account, string encryption)
        {
            InitializeComponent();
            textBox1.Text = account.ToString();
            textBox1.ReadOnly = true;
            id = account; // 设置用户ID
            ldentificationCode = encryption; // 设置身份验证代码
        }

        private void ModifyUser_Load(object sender, EventArgs e)
        {

        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            int newAccount = int.Parse(textBox2.Text);
            tables.UpdateUserId(newAccount, ldentificationCode);
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
            this.Dispose();
        }

        private void textBox2_TextChanged(object sender, EventArgs e)
        {

        }
    }
}
